-
-
Notifications
You must be signed in to change notification settings - Fork 193
BE: Issue#1332 Sort based on prefix offsets #1421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request implements sorting functionality based on prefix offsets for Lucene topic search. The changes improve search result ranking by prioritizing matches where search terms appear earlier in topic names.
- Introduces a custom scoring function that calculates position-based scores for search prefixes
- Adds support for offset tracking in the word analyzer and text field indexing
- Implements comprehensive test coverage for the new ordering functionality
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| ShortWordAnalyzer.java | Modified to support offset tracking and moved to lucene package |
| IndexedTextField.java | New custom text field implementation with offset support |
| NameDistanceScoringFunction.java | New scoring function that ranks results by prefix position |
| PrefixQueryParser.java | Enhanced to track search prefixes for scoring |
| LuceneTopicsIndex.java | Updated to use new components and apply position-based scoring |
| ShortWordAnalyzerTest.java | New test class validating analyzer offset behavior |
| LuceneTopicsIndexTest.java | Enhanced with ordering tests and moved to lucene package |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
What changes did you make? (Give an overview)
Is there anything you'd like reviewers to focus on?
How Has This Been Tested? (put an "x" (case-sensitive!) next to an item)
Checklist (put an "x" (case-sensitive!) next to all the items, otherwise the build will fail)
Check out Contributing and Code of Conduct
A picture of a cute animal (not mandatory but encouraged)